//# 1 "/tmp/tews/ov-dist/ov-chip-2-2010-09-20/gui/netbeans/ov_demo_gui/src/ds/ov2/gui/Config_window.java"
// 
// OV-chip 2.0 project
// 
// Digital Security (DS) group at Radboud Universiteit Nijmegen
// 
// Copyright (C) 2009
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License in file COPYING in this or one of the
// parent directories for more details.
// 
// Created 5.1.09 by Hendrik
// 
// netbeans generated code for the config window
// 
// $Id: Config_window.java,v 1.10 2010-02-18 14:02:08 tews Exp $

package ds.ov2.gui;

import javax.swing.DefaultComboBoxModel;

/**
 * netbeans generated code for the config window. This class contains
 * only the code to create the window with all its components. The
 * actions that are performed are in {@link Config_actions}.
 *
 *
 * @author Hendrik Tews
 * @version $Revision: 1.10 $
 * @commitdate $Date: 2010-02-18 14:02:08 $ by $Author: tews $
 * @environment host
 * @CPP no cpp preprocessing needed
 */
public class Config_window extends javax.swing.JDialog {

    /** serialVersionUID for the Serializable interface */
    public static final long serialVersionUID = 1L;


    /**
     * 
     * The action instance.
     */
    public final Config_actions config_actions;

    /** Initially false. Changed to true when the dialog is left via OK. */
    public boolean finished_ok = false;


    /** Creates new form Config_window */
    public Config_window(java.awt.Frame parent, boolean modal, Config_actions config_actions) {
        super(parent, modal);
        this.config_actions = config_actions;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        card_terminal_combo_box = new javax.swing.JComboBox();
        config_ok_button = new javax.swing.JButton();
        config_dismiss_button = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        config_plain_applet_name_text_field = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        config_plain_applet_browse_button = new javax.swing.JButton();
        config_mont_applet_name_text_field = new javax.swing.JTextField();
        config_mont_applet_browse_button = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        config_square_4_applet_name_text_field = new javax.swing.JTextField();
        config_square_4_applet_browse_button = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        config_square_2_applet_name_text_field = new javax.swing.JTextField();
        config_square_2_applet_browse_button1 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        config_invalid_key_size_warning_check_box = new javax.swing.JCheckBox();
        config_long_key_size_warning_check_box = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Card Reader"));

        jLabel1.setText("Select the card reader to attach to:");

        card_terminal_combo_box.setModel(new DefaultComboBoxModel(config_actions.get_all_readers()));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(card_terminal_combo_box, 0, 383, Short.MAX_VALUE)
                    .addComponent(jLabel1))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(card_terminal_combo_box, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );

        config_ok_button.setText("OK");
        config_ok_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                config_ok_buttonActionPerformed(evt);
            }
        });

        config_dismiss_button.setText("Dismiss");
        config_dismiss_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                config_dismiss_buttonActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("OV Chip Applets"));

        jLabel2.setText("Plain coprocessor applet");

        jLabel3.setText("Pure Montgomerizing applet");

        config_plain_applet_browse_button.setText("Browse");
        config_plain_applet_browse_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                config_plain_applet_browse_buttonActionPerformed(evt);
            }
        });

        config_mont_applet_browse_button.setText("Browse");
        config_mont_applet_browse_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                config_mont_applet_browse_buttonActionPerformed(evt);
            }
        });

        jLabel4.setText("Plain square 4 applet");

        config_square_4_applet_browse_button.setText("Browse");
        config_square_4_applet_browse_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                config_square_4_applet_browse_buttonActionPerformed(evt);
            }
        });

        jLabel5.setText("Plain square 2 applet");

        config_square_2_applet_browse_button1.setText("Browse");
        config_square_2_applet_browse_button1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                config_square_2_applet_browse_button1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(config_square_4_applet_name_text_field, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(config_square_4_applet_browse_button))
                    .addComponent(jLabel5)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(config_square_2_applet_name_text_field, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(config_square_2_applet_browse_button1))
                    .addComponent(jLabel2)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(config_plain_applet_name_text_field, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(config_plain_applet_browse_button))
                    .addComponent(jLabel3)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(config_mont_applet_name_text_field, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(config_mont_applet_browse_button)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(config_square_4_applet_name_text_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(config_square_4_applet_browse_button))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(config_square_2_applet_name_text_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(config_square_2_applet_browse_button1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(config_plain_applet_name_text_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(config_plain_applet_browse_button))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(config_mont_applet_name_text_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(config_mont_applet_browse_button))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Warnings"));

        config_invalid_key_size_warning_check_box.setText("warn about invalid key sizes");

        config_long_key_size_warning_check_box.setText("warn about key sizes that lead to long transaction times");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(config_invalid_key_size_warning_check_box)
                    .addComponent(config_long_key_size_warning_check_box))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(config_invalid_key_size_warning_check_box)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(config_long_key_size_warning_check_box)
                .addContainerGap(10, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(config_ok_button)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(config_dismiss_button))
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {config_dismiss_button, config_ok_button});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(config_dismiss_button)
                    .addComponent(config_ok_button))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void config_dismiss_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_config_dismiss_buttonActionPerformed
        config_actions.dismiss_button(this);
}//GEN-LAST:event_config_dismiss_buttonActionPerformed

    private void config_ok_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_config_ok_buttonActionPerformed
        config_actions.ok_button(this);
    }//GEN-LAST:event_config_ok_buttonActionPerformed

    private void config_plain_applet_browse_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_config_plain_applet_browse_buttonActionPerformed
        config_actions.applet_browse_button(this, config_plain_applet_name_text_field);
    }//GEN-LAST:event_config_plain_applet_browse_buttonActionPerformed

    private void config_mont_applet_browse_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_config_mont_applet_browse_buttonActionPerformed
        config_actions.applet_browse_button(this, config_mont_applet_name_text_field);
    }//GEN-LAST:event_config_mont_applet_browse_buttonActionPerformed

    private void config_square_4_applet_browse_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_config_square_4_applet_browse_buttonActionPerformed
        config_actions.applet_browse_button(this, config_square_4_applet_name_text_field);
}//GEN-LAST:event_config_square_4_applet_browse_buttonActionPerformed

    private void config_square_2_applet_browse_button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_config_square_2_applet_browse_button1ActionPerformed
        config_actions.applet_browse_button(this, config_square_2_applet_name_text_field);
    }//GEN-LAST:event_config_square_2_applet_browse_button1ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    javax.swing.JComboBox card_terminal_combo_box;
    private javax.swing.JButton config_dismiss_button;
    javax.swing.JCheckBox config_invalid_key_size_warning_check_box;
    javax.swing.JCheckBox config_long_key_size_warning_check_box;
    private javax.swing.JButton config_mont_applet_browse_button;
    javax.swing.JTextField config_mont_applet_name_text_field;
    private javax.swing.JButton config_ok_button;
    private javax.swing.JButton config_plain_applet_browse_button;
    javax.swing.JTextField config_plain_applet_name_text_field;
    private javax.swing.JButton config_square_2_applet_browse_button1;
    javax.swing.JTextField config_square_2_applet_name_text_field;
    private javax.swing.JButton config_square_4_applet_browse_button;
    javax.swing.JTextField config_square_4_applet_name_text_field;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    // End of variables declaration//GEN-END:variables

}
